import request from '../request.js'
var TEMP = "?HTTP_RSPCSFTOKEN=AZNeiGIlUAC3F8F58GbcXFzYiKvmLVpfUprpreGqJf1ad0YAHWabaHtM1PZbWY52&HTTP_RSPSESSIONID=jbc5jbo1anydyw5zh8o69s5y85r7n1yj"

// 获取用户信息
export const getUserInfo = () => {
	return request.get({url: '/v0.1/user/user/'})
}

// 获取车牌列表
export const getCarNumList = params => {
	return request.get({url: '/v0.1/user/vehicle/', refresh: true})
}

// 添加车牌号
export const addCarNum = params => {
	return request.post({url: '/v0.1/user/platenum_man/', data:params})
}

// 修改车牌号
export const changeCarNum = params => {
	return request.put({url: '/v0.1/user/platenum_man/', data:params})
}

// 删除车牌号
export const deleteCarNum = params => {
	return request.del({url: '/v0.1/user/platenum_man/', data:params})
}

// 绑定车牌号
export const bindCarNum = params => {
	return request.post({url: '/v0.1/user/bind_platenumber/', data:params})
}
// 解绑车牌号
export const unbindCarNum = params => {
	return request.put({url: '/v0.1/user/bind_platenumber/', data:params})
}
// 绑定星城智卡
export const lcxxredict = params => {
	return request.post({url: '/v0.1/user/lcxxredict/', data:params})
}
// 查看星城智卡
export const epl_user_info = params => {
	return request.get({url: '/v0.1/user/user_info/', data:params})
}
//星城智卡 设置免密支付
export const epl_user_info_nopw = params => {
	return request.post({url: '/v0.1/user/user_info/', data:params})
}

// 修改支付密码
export const changePayPassword = params => {
	return request.post({url: '/v0.1/account/payment_password/', data:params})
}

// 获取车牌订单信息
export const getOnlineOrder = params => {
	return request.post({url: '/v0.1/billing/onlineorder/', data:params})
}

// 获取订单详情
export const getOrdermanage = params => {
	return request.get({url: '/v0.1/billing/ordermanage/', data:params})
}
export const getOrderDetail = params => {
	return request.get({url: '/v0.1/billing/order_detail/', data:params})
}

// 获取订单列表
export const parklot_order = params => {
	return request.get({url: '/v0.1/billing/parklot_order/', data:params})
}

// 待缴费订单
export const arrears_order = params => {
	return request.get({url: '/v0.1/billing/arrears_order/', data:params})
}
export const arrears_order_new = params => {
	return request.get({url: '/v0.1/billing/arrears_order_new/', data:params, refresh: true})
}

// 已缴费订单
export const paid_order = params => {
	return request.get({url: '/v0.1/billing/paid_order/', data:params})
}
// 已缴费订单-新接口
export const paid_order_new = params => {
	return request.get({url: '/v0.1/billing/paid_order_new/', data:params, refresh: true})
}


// 获取账单列表
export const getOnlinebill = params => {
	return request.get({url: '/v0.1/billing/onlinebill/', data:params})
}
// 长沙银行绑定
export const webservice4csyh = params => {
	return request.get({url: '/v0.1/join3rd/webservice4csyh/', data:params})
}
// 签约数字人民币
export const bcmsignup = params => {
	return request.post({url: '/v0.1/billing/bcmsignup/', data:params})
}
export const get_bcmsignup = params => {
	return request.get({url: '/v0.1/billing/bcmsignup/', data:params})
}


// 支付
export const getPay = params => {
	return request.post({url: '/v0.1/billing/pay/', data:params})
}
// 支付新接口
export const getPaying = params => {
	return request.post({url: '/v0.1/billing/paying/', data:params})
}

// 数字人民币支付
export const bcmquery_pay = params => {
	return request.get({url: '/v0.1/billing/bcmquery/', data:params})
}

// 关闭支付
export const closePay = params => {
	return request.post({url: '/v0.1/billing/orderclose/', data:params})
}
// 获取用户余额
export const balance = params => {
	return request.get({url: '/v0.1/user/balance/'})
}

// 登录状态下的优惠卷查询
export const getUserCoupon = params => {
	return request.get({url: '/v0.1/coupon/query/coupon/', data:params, refresh: true})
}

// 自定义订单优惠卷
export const parkingOrderCoupon = params => {
	return request.get({url: '/v0.1/coupon/charging/', data:params, refresh: true})
}

// 意见反馈
export const userComment = params => {
	return request.post({url: '/v0.1/user/comm_temp/', data:params})  //新接口
	// return request.post({url: '/v0.1/user/reply/', data:params})
}

// 获取意见反馈列表
export const getCommentList = params => {
	return request.get({url: '/v0.1/user/comm_temp/', data:params, refresh: true})  //新接口
	// return request.get({url: '/v0.1/user/reply/', data:params})
}
// 获取单个意见反馈列表
export const getCommentList_1 = params => {
	return request.get({url: '/v0.1/user/comm_temp/'+params.objid+'/'})  //新接口
	// return request.get({url: '/v0.1/user/reply/'+params.objid+'/'})
}


// 余额支付
export const getOnlinePay = params => {
	return request.post({url: '/v0.1/billing/onlinepay/', data:params})
}

// 获取版本信息
export const getVersion = params => {
	return request.get({url: '/v0.1/appman/version/', data:params, refresh: true})
}

// 获取最新的apk
export const getNewApk = params => {
	return request.get({url: '/media/'+params })
}

//修改呢称
export const change_nickname = params => {
	return request.put({url: '/v0.1/user/user/?nickname='+params})
}
//获取头像 
export const getAvatar = params => {
	return request.get({url: '/v0.1/user/avatar/'})
}
// 申请退款
export const approval_audit = params => {
	return request.post({url: '/v0.1/approval/audit/', data:params})
}
// 退款记录
export const audit_record = params => {
	return request.get({url: '/v0.1/approval/audit/', data:params})
}
//修改头像 
export const updateAvatar = params => {
	return request.post({url: '/v0.1/user/avatar/', data:params})
}
//月卡 
export const month_card = params => {
	return request.get({url: '/v0.1/month_card/card_manage/', data:params})
}
// 停车卡类型
export const card_kind = params => {
	//return request.get({url: '/v0.1/month_card/card_kind/?status=1'})
	return request.get({url: '/v0.1/month_card/card_kind/?status=1&for_front=1'})
}
// 计算金额
export const card_renew_logout = params => {
	return request.get({url: '/v0.1/month_card/card_renew_logout/', data:params})
}
// 新闻资讯
// export const appnews_manage = params => {// 	return request.get({url: '/v0.1/appman/appnews_manage/?is_active=True&type=cover_page'})// }

//旧版 新闻资讯 
// export const appnews_manage = params => {// 	return request.get({url: '/v0.1/appman/appnews',data:params})// }
// export const appimage = params => {// 	return request.get({url: '/v0.1/appman/appimage',data:params})// }
//新版 新闻资讯    目前使用
export const appnews_manage = params => {	return request.get({url: '/v0.1/appman/appnews_manage/', data:params, refresh: true})}
// 统计
export const hits_count = params => {	return request.put({url: '/v0.1/appman/hits_count/',data:params})}


// 自主泊位
export const parkberthextra = params => {	return request.post({url: '/v0.1/parking/parkberthextra/', data:params})}

// 发票抬头
export const kMethodUserConf = (params, type, id) => {
	if(type == 'get'){
		return request.get({url: '/v0.1/invoices/user_conf/', data: params})
	}else if(type == 'post'){
		return request.post({url: '/v0.1/invoices/user_conf/', data:params})
	}else{
		if(id){
			return request.put({url: '/v0.1/invoices/user_conf/' + id + '/', data:params})
		}
	}
}

// 开票
export const kMethodInvoice = (params, type, id) => {
	if(type == 'get'){
		if(id){
			return request.get({url: '/v0.1/invoices/invoicing/' + id + '/'})
		}else{
			return request.get({url: '/v0.1/invoices/invoicing/', data: params})
		}
	}else if(type == 'post'){
		return request.post({url: '/v0.1/invoices/invoicing/', data:params})
	}else{
		return request.put({url: '/v0.1/invoices/invoicing/', data:params})
	}
	
}

